package com.awplanet.sitegen.template;

import com.awplanet.sitegen.constant.Constant;

import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * User: a_polyakov
 */
public class StringTemplate extends AbstractTemplate {
	private byte[] data;

	public StringTemplate(String text) {
		try {
			data = text.getBytes(Constant.UTF_8);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void write(OutputStream outputStream, Map<String, String> attrs, Map<String, Object> hideAttr) throws IOException {
		outputStream.write(data);
	}
}
